<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>居中定位案例</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        .nav {
            width: 1000px;
            height: 35px;
            border: 1px solid black;
            text-decoration: none;
        }

        li {
            border-right: 1px solid black;
            float: left;
            list-style: none;
            line-height: 35px;
            margin: 0 10px;
            padding: 0 25px;
            text-decoration: none;
        }
        .father {
            position: relative;
        }
        .son {
            /* 子绝父相 */
            position: absolute;
            left: 50%;
            /* 只水平居中 */
            transform: translate(-50%);
            top: 35px;
        }
    </style>
</head>

<body>
    <div class="nav">
        <li><a href="">我要投资</a></li>
        <li><a href="">平台介绍</a></li>
        <li><a href="">新手专区</a></li>
        <li class="father"><a href="">手机端<img src="./erweima.png" alt="" class="son"></a></li>
        <li><a href="">个人中心</a></li>
    </div>

</body>

</html>